package com.example.summer_pro.service.Impl;

import com.example.summer_pro.dao.ContentDao;
import com.example.summer_pro.entity.Content;
import com.example.summer_pro.entity.ContentJSON;
import com.example.summer_pro.entity.NormalsJSON;
import com.example.summer_pro.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContentServiceImpl implements ContentService {
    @Autowired
    private ContentDao contentDao;
    @Override
    public Content selectContent(int u_id, int q_id, int t_id) {
        return contentDao.selectContent(u_id, q_id, t_id);
    }

    @Override
    public void addNewContent(Content content) {
        contentDao.addNewContent(content);
    }

    @Override
    public void updateContent(Content content) {
        contentDao.updateContent(content);
    }

    @Override
    public void deleteContent(Content content) {
        contentDao.deleteContent(content);
    }

    @Override
    public List<Content> selectResult(int q_id, int t_id){ return contentDao.selectResult(q_id, t_id); }

    @Override
    public void addJson(Integer q_id,Integer u_id, String json) {
        contentDao.addJson(q_id,u_id,json);
    }

    @Override
    public void deleteJson(Integer q_id,Integer u_id) {
        contentDao.deleteJson(q_id,u_id);
    }

    @Override
    public ContentJSON selectJson(Integer q_id,Integer u_id) {
        return contentDao.selectJson(q_id,u_id);
    }

    @Override
    public void deleteAllContent(Integer q_id,Integer u_id){
        contentDao.deleteAllContent(q_id,u_id);
    }
}
